Module-level declarations

Functions

Link copied to clipboard
function burn_message(gtv: gtv): text
Link copied to clipboard
@extend(auth_handler) function (): map<text, _auth_handler>
Link copied to clipboard
@extend(auth_handler) function (): map<text, _auth_handler>
Link copied to clipboard
@extend(auth_handler) function (): map<text, _auth_handler>
Link copied to clipboard
function transfer_message(gtv: gtv): text

Queries

Link copied to clipboard
@mount("ft4.get_all_assets") query get_all_assets(page_size: integer?, page_cursor: text?): paged_result

Retrieves all registered assets, paginated.

Link copied to clipboard
@mount("ft4.get_asset_balance") query get_asset_balance(account_id: byte_array, asset_id: byte_array): ((id: byte_array, name: text, symbol: text, decimals: integer, blockchain_rid: byte_array, icon_url: text, type: text, supply: big_integer), amount: big_integer)?

Returns how much of an asset the account holds. This query returns null if the account does not have the asset.

Link copied to clipboard
@mount("ft4.get_asset_balances") query get_asset_balances(account_id: byte_array, page_size: integer?, page_cursor: text?): paged_result

Retrieves all the balances of a certain account, paginated.

Link copied to clipboard
@mount("ft4.get_asset_by_id") query get_asset_by_id(asset_id: byte_array): (id: byte_array, name: text, symbol: text, decimals: integer, blockchain_rid: byte_array, icon_url: text, type: text, supply: big_integer)?

Returns the details of an asset given its id

@mount("ft4.get_asset_details_for_crosschain_registration") query get_asset_details_for_crosschain_registration(asset_id: byte_array): (id: byte_array, name: text, symbol: text, decimals: integer, blockchain_rid: byte_array, icon_url: text, type: text, uniqueness_resolver: byte_array)

Outputs the details of an asset in a format that is used by other chains to register it as a crosschain asset.

Throws if the asset does not exist on this chain.

Link copied to clipboard
@mount("ft4.get_assets_by_name") query get_assets_by_name(name: text, page_size: integer?, page_cursor: text?): paged_result

Returns all assets that have the specified name, paginated.

Link copied to clipboard
@mount("ft4.get_assets_by_symbol") query get_assets_by_symbol(symbol: text, page_size: integer?, page_cursor: text?): paged_result

Retrieves all assets with the given symbol, paginated.

Link copied to clipboard
@mount("ft4.get_assets_by_type") query get_assets_by_type(type: text, page_size: integer?, page_cursor: text?): paged_result

Retrieves all assets of a specified type, paginated.

Link copied to clipboard
@mount("ft4.get_transfer_details") query get_transfer_details(tx_rid: byte_array, op_index: integer): set<transfer_detail>

Returns a transfer_detail object for each transfer_entry that was registered during the operation specified.

Link copied to clipboard
@mount("ft4.get_transfer_details_by_asset") query get_transfer_details_by_asset(tx_rid: byte_array, op_index: integer, asset_id: byte_array): set<transfer_detail>

Same as get_transfer_details, but restricts the results to transfer entries related to the asset specified.

Link copied to clipboard
@mount("ft4.get_transfer_history") query get_transfer_history(account_id: byte_array, filter: filter, page_size: integer?, page_cursor: text?): paged_result?

Fetches all transfers to and from an account, allowing filtering in multiple ways. Paginated.

Link copied to clipboard
@mount("ft4.get_transfer_history_entry") query get_transfer_history_entry(rowid: rowid): (id: rowid, delta: big_integer, decimals: integer, (id: byte_array, name: text, symbol: text, decimals: integer, blockchain_rid: byte_array, icon_url: text, type: text, supply: big_integer), is_input: boolean, timestamp: integer, block_height: integer, tx_rid: byte_array, tx_data: byte_array, operation_name: text, op_index: integer, is_crosschain: boolean)?

Retrieves a transfer history entry given its rowid. Said rowid can be acquired by for example using the get_transfer_history query.

Returns null if no transfer history is found at the specified rowid

Link copied to clipboard
@mount("ft4.get_transfer_history_from_height") query get_transfer_history_from_height(height: integer, asset_id: byte_array?, page_size: integer?, page_cursor: text?): paged_result

Fetches all transfers to and from an any account, which occurred after a specific height. Paginated.

Operations

Link copied to clipboard
@mount("ft4.burn") operation burn(asset_id: byte_array, amount: big_integer)

Deletes tokens from an account's balance, decreasing the total supply by the amount being burned.

Must be signed by an auth descriptor with accounts.auth_flags.TRANSFER

Throws if the required assets cannot be burned. Common cases include:

  • the account balance is lower than amount

  • the amount to burn is not in the accepted range (0; 2^256) (exclusive)

  • some conditions added in development through burn extensions (before_burn or after_burn) aren't met

Link copied to clipboard
@mount("ft4.recall_unclaimed_transfer") operation recall_unclaimed_transfer(transfer_tx_rid: byte_array, transfer_op_index: integer)

Allows recalling a transfer that was sent to a non-existing account and was not used to create the account.

Must be signed by an auth descriptor with accounts.auth_flags.TRANSFER

Throws if recalling is impossible. Common cases include:

  • account registration on transfer is not allowed

  • some conditions added in development through recall_on_internal_transfer extensions (recall_on_internal_transfer) aren't met

Link copied to clipboard
@mount("ft4.transfer") operation transfer(recipient_id: byte_array, asset_id: byte_array, amount: big_integer)

Transfers tokens to a certain recipient.

  • if the recipient exists, a normal transfer will take place;

  • otherwise:

    • if account creation on transfer is enabled, the account registration procedure will be started;

    • an error is thrown

Must be signed by an auth descriptor with accounts.auth_flags.TRANSFER

Throws if the required assets cannot be transferred. Common cases include:

  • the sender account's balance is lower than amount

  • the amount to transfer is not in the accepted range (0, 2^256) (exclusive)

  • some conditions added in development through transfer extensions (before_transfer or after_transfer) aren't met